//
//  WBStatusCell.swift
//  daoge_sineweibo
//
//  Created by 伍禄林 on 16/10/15.
//  Copyright © 2016年 伍禄林. All rights reserved.
//

import UIKit

class WBStatusCell: UITableViewCell {
    
    var viewModel: WBStatusViewModel? {
        
        didSet {
            
            statusLabel.text = viewModel?.status.text
            nameLabel.text = viewModel?.status.user?.screen_name
            
            memberIconView.image = viewModel?.memberIcon
            vipIconView.image = viewModel?.vipIcon
            
            iconView.cz_setImage(urlString: viewModel?.status.user?.profile_image_url, placeholderImage: UIImage(named: "avatar_default_big"),isAvater: true)
            
            statusToolBarView.viewModel = viewModel
            
            pictureView.viewModel = viewModel
            
            retweetedLabel?.text = viewModel?.retweetedStatusText
            
        }
        
    }
    
    @IBOutlet weak var iconView: UIImageView!
    
    @IBOutlet weak var nameLabel: UILabel!
    
    
    @IBOutlet weak var memberIconView: UIImageView!
    
    @IBOutlet weak var timeLabel: UILabel!
    
    @IBOutlet weak var sourceLabel: UILabel!

    @IBOutlet weak var vipIconView: UIImageView!
    
    @IBOutlet weak var statusLabel: UILabel!
    
    @IBOutlet weak var statusToolBarView: WBStatusToolBar!
    
    @IBOutlet weak var pictureView: WBStatusPictureView!
    
    @IBOutlet weak var pictureTopCons: NSLayoutConstraint!
    
    @IBOutlet weak var retweetedLabel: UILabel?
    override func awakeFromNib() {
        super.awakeFromNib()
        //离屏渲染  异步绘制
        self.layer.drawsAsynchronously = true
        //栅格化
        self.layer.shouldRasterize = true
        //使用 ‘栅格化’ 必须制定分辨率
         self.layer.rasterizationScale = UIScreen.main.scale
    }

    

}
